//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Repostspace {
    // MARK: Enums

    public enum ChannelRole: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case asker = "ASKER"
        case expert = "EXPERT"
        case moderator = "MODERATOR"
        case supportrequestor = "SUPPORTREQUESTOR"
        public var description: String { return self.rawValue }
    }

    public enum ChannelStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case createFailed = "CREATE_FAILED"
        case created = "CREATED"
        case creating = "CREATING"
        case deleteFailed = "DELETE_FAILED"
        case deleted = "DELETED"
        case deleting = "DELETING"
        public var description: String { return self.rawValue }
    }

    public enum ConfigurationStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case configured = "CONFIGURED"
        case unconfigured = "UNCONFIGURED"
        public var description: String { return self.rawValue }
    }

    public enum FeatureEnableParameter: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum FeatureEnableStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        case notAllowed = "NOT_ALLOWED"
        public var description: String { return self.rawValue }
    }

    public enum Role: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case administrator = "ADMINISTRATOR"
        case expert = "EXPERT"
        case moderator = "MODERATOR"
        case supportrequestor = "SUPPORTREQUESTOR"
        public var description: String { return self.rawValue }
    }

    public enum TierLevel: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case basic = "BASIC"
        case standard = "STANDARD"
        public var description: String { return self.rawValue }
    }

    public enum ValidationExceptionReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cannotParse = "cannotParse"
        case fieldValidationFailed = "fieldValidationFailed"
        case other = "other"
        case unknownOperation = "unknownOperation"
        public var description: String { return self.rawValue }
    }

    public enum VanityDomainStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case approved = "APPROVED"
        case pending = "PENDING"
        case unapproved = "UNAPPROVED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct BatchAddChannelRoleToAccessorsInput: AWSEncodableShape {
        /// The user or group identifiers to add the role to.
        public let accessorIds: [String]
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The channel role to add to the users or groups.
        public let channelRole: ChannelRole
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(accessorIds: [String], channelId: String, channelRole: ChannelRole, spaceId: String) {
            self.accessorIds = accessorIds
            self.channelId = channelId
            self.channelRole = channelRole
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.accessorIds, forKey: .accessorIds)
            request.encodePath(self.channelId, key: "channelId")
            try container.encode(self.channelRole, forKey: .channelRole)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accessorIds, name: "accessorIds", parent: name, max: 1000)
            try self.validate(self.channelId, name: "channelId", parent: name, max: 24)
            try self.validate(self.channelId, name: "channelId", parent: name, min: 24)
        }

        private enum CodingKeys: String, CodingKey {
            case accessorIds = "accessorIds"
            case channelRole = "channelRole"
        }
    }

    public struct BatchAddChannelRoleToAccessorsOutput: AWSDecodableShape {
        /// An array of successfully updated identifiers.
        public let addedAccessorIds: [String]
        /// An array of errors that occurred when roles were added.
        public let errors: [BatchError]

        @inlinable
        public init(addedAccessorIds: [String], errors: [BatchError]) {
            self.addedAccessorIds = addedAccessorIds
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case addedAccessorIds = "addedAccessorIds"
            case errors = "errors"
        }
    }

    public struct BatchAddRoleInput: AWSEncodableShape {
        /// The user or group accessor identifiers to add the role to.
        public let accessorIds: [String]
        /// The role to add to the users or groups.
        public let role: Role
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(accessorIds: [String], role: Role, spaceId: String) {
            self.accessorIds = accessorIds
            self.role = role
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.accessorIds, forKey: .accessorIds)
            try container.encode(self.role, forKey: .role)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accessorIds, name: "accessorIds", parent: name, max: 1000)
        }

        private enum CodingKeys: String, CodingKey {
            case accessorIds = "accessorIds"
            case role = "role"
        }
    }

    public struct BatchAddRoleOutput: AWSDecodableShape {
        /// An array of successfully updated accessor identifiers.
        public let addedAccessorIds: [String]
        /// An array of errors that occurred when roles were added.
        public let errors: [BatchError]

        @inlinable
        public init(addedAccessorIds: [String], errors: [BatchError]) {
            self.addedAccessorIds = addedAccessorIds
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case addedAccessorIds = "addedAccessorIds"
            case errors = "errors"
        }
    }

    public struct BatchError: AWSDecodableShape {
        /// The accessor identifier that's related to the error.
        public let accessorId: String
        /// The error code.
        public let error: Int
        /// Description of the error.
        public let message: String

        @inlinable
        public init(accessorId: String, error: Int, message: String) {
            self.accessorId = accessorId
            self.error = error
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case accessorId = "accessorId"
            case error = "error"
            case message = "message"
        }
    }

    public struct BatchRemoveChannelRoleFromAccessorsInput: AWSEncodableShape {
        /// The users or groups identifiers to remove the role from.
        public let accessorIds: [String]
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The channel role to remove from the users or groups.
        public let channelRole: ChannelRole
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(accessorIds: [String], channelId: String, channelRole: ChannelRole, spaceId: String) {
            self.accessorIds = accessorIds
            self.channelId = channelId
            self.channelRole = channelRole
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.accessorIds, forKey: .accessorIds)
            request.encodePath(self.channelId, key: "channelId")
            try container.encode(self.channelRole, forKey: .channelRole)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accessorIds, name: "accessorIds", parent: name, max: 1000)
            try self.validate(self.channelId, name: "channelId", parent: name, max: 24)
            try self.validate(self.channelId, name: "channelId", parent: name, min: 24)
        }

        private enum CodingKeys: String, CodingKey {
            case accessorIds = "accessorIds"
            case channelRole = "channelRole"
        }
    }

    public struct BatchRemoveChannelRoleFromAccessorsOutput: AWSDecodableShape {
        /// An array of errors that occurred when roles were removed.
        public let errors: [BatchError]
        /// An array of successfully updated identifiers.
        public let removedAccessorIds: [String]

        @inlinable
        public init(errors: [BatchError], removedAccessorIds: [String]) {
            self.errors = errors
            self.removedAccessorIds = removedAccessorIds
        }

        private enum CodingKeys: String, CodingKey {
            case errors = "errors"
            case removedAccessorIds = "removedAccessorIds"
        }
    }

    public struct BatchRemoveRoleInput: AWSEncodableShape {
        /// The user or group accessor identifiers to remove the role from.
        public let accessorIds: [String]
        /// The role to remove from the users or groups.
        public let role: Role
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(accessorIds: [String], role: Role, spaceId: String) {
            self.accessorIds = accessorIds
            self.role = role
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.accessorIds, forKey: .accessorIds)
            try container.encode(self.role, forKey: .role)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.accessorIds, name: "accessorIds", parent: name, max: 1000)
        }

        private enum CodingKeys: String, CodingKey {
            case accessorIds = "accessorIds"
            case role = "role"
        }
    }

    public struct BatchRemoveRoleOutput: AWSDecodableShape {
        /// An array of errors that occurred when roles were removed.
        public let errors: [BatchError]
        /// An array of successfully updated accessor identifiers.
        public let removedAccessorIds: [String]

        @inlinable
        public init(errors: [BatchError], removedAccessorIds: [String]) {
            self.errors = errors
            self.removedAccessorIds = removedAccessorIds
        }

        private enum CodingKeys: String, CodingKey {
            case errors = "errors"
            case removedAccessorIds = "removedAccessorIds"
        }
    }

    public struct ChannelData: AWSDecodableShape {
        /// A description for the channel. This is used only to help you identify this channel.
        public let channelDescription: String?
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The name for the channel. This must be unique per private re:Post.
        public let channelName: String
        /// The status pf the channel.
        public let channelStatus: ChannelStatus
        /// The date when the channel was created.
        public let createDateTime: Date
        /// The date when the channel was deleted.
        public let deleteDateTime: Date?
        /// The number of groups that are part of the channel.
        public let groupCount: Int
        /// The unique ID of the private re:Post.
        public let spaceId: String
        /// The number of users that are part of the channel.
        public let userCount: Int

        @inlinable
        public init(channelDescription: String? = nil, channelId: String, channelName: String, channelStatus: ChannelStatus, createDateTime: Date, deleteDateTime: Date? = nil, groupCount: Int, spaceId: String, userCount: Int) {
            self.channelDescription = channelDescription
            self.channelId = channelId
            self.channelName = channelName
            self.channelStatus = channelStatus
            self.createDateTime = createDateTime
            self.deleteDateTime = deleteDateTime
            self.groupCount = groupCount
            self.spaceId = spaceId
            self.userCount = userCount
        }

        private enum CodingKeys: String, CodingKey {
            case channelDescription = "channelDescription"
            case channelId = "channelId"
            case channelName = "channelName"
            case channelStatus = "channelStatus"
            case createDateTime = "createDateTime"
            case deleteDateTime = "deleteDateTime"
            case groupCount = "groupCount"
            case spaceId = "spaceId"
            case userCount = "userCount"
        }
    }

    public struct ConflictException: AWSErrorShape {
        public let message: String
        /// The ID of the resource.
        public let resourceId: String
        /// The type of the resource.
        public let resourceType: String

        @inlinable
        public init(message: String, resourceId: String, resourceType: String) {
            self.message = message
            self.resourceId = resourceId
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case resourceId = "resourceId"
            case resourceType = "resourceType"
        }
    }

    public struct CreateChannelInput: AWSEncodableShape {
        /// A description for the channel. This is used only to help you identify this channel.
        public let channelDescription: String?
        /// The name for the channel. This must be unique per private re:Post.
        public let channelName: String
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(channelDescription: String? = nil, channelName: String, spaceId: String) {
            self.channelDescription = channelDescription
            self.channelName = channelName
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.channelDescription, forKey: .channelDescription)
            try container.encode(self.channelName, forKey: .channelName)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.channelDescription, name: "channelDescription", parent: name, max: 255)
            try self.validate(self.channelDescription, name: "channelDescription", parent: name, min: 1)
            try self.validate(self.channelName, name: "channelName", parent: name, max: 64)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case channelDescription = "channelDescription"
            case channelName = "channelName"
        }
    }

    public struct CreateChannelOutput: AWSDecodableShape {
        /// The unique ID of the private re:Post channel.
        public let channelId: String

        @inlinable
        public init(channelId: String) {
            self.channelId = channelId
        }

        private enum CodingKeys: String, CodingKey {
            case channelId = "channelId"
        }
    }

    public struct CreateSpaceInput: AWSEncodableShape {
        /// A description for the private re:Post. This is used only to help you identify this private re:Post.
        public let description: String?
        /// The name for the private re:Post. This must be unique in your account.
        public let name: String
        /// The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.
        public let roleArn: String?
        /// The subdomain that you use to access your AWS re:Post Private private re:Post. All custom subdomains must be approved by AWS before use. In addition to your custom subdomain, all private re:Posts are issued an AWS generated subdomain for immediate use.
        public let subdomain: String
        public let supportedEmailDomains: SupportedEmailDomainsParameters?
        /// The list of tags associated with the private re:Post.
        public let tags: [String: String]?
        /// The pricing tier for the private re:Post.
        public let tier: TierLevel
        /// The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't provide a key, your data is encrypted by default with a key that AWS owns and manages for you.
        public let userKMSKey: String?

        @inlinable
        public init(description: String? = nil, name: String, roleArn: String? = nil, subdomain: String, supportedEmailDomains: SupportedEmailDomainsParameters? = nil, tags: [String: String]? = nil, tier: TierLevel, userKMSKey: String? = nil) {
            self.description = description
            self.name = name
            self.roleArn = roleArn
            self.subdomain = subdomain
            self.supportedEmailDomains = supportedEmailDomains
            self.tags = tags
            self.tier = tier
            self.userKMSKey = userKMSKey
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 255)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 30)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.subdomain, name: "subdomain", parent: name, max: 63)
            try self.validate(self.subdomain, name: "subdomain", parent: name, min: 1)
            try self.supportedEmailDomains?.validate(name: "\(name).supportedEmailDomains")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case description = "description"
            case name = "name"
            case roleArn = "roleArn"
            case subdomain = "subdomain"
            case supportedEmailDomains = "supportedEmailDomains"
            case tags = "tags"
            case tier = "tier"
            case userKMSKey = "userKMSKey"
        }
    }

    public struct CreateSpaceOutput: AWSDecodableShape {
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(spaceId: String) {
            self.spaceId = spaceId
        }

        private enum CodingKeys: String, CodingKey {
            case spaceId = "spaceId"
        }
    }

    public struct DeleteSpaceInput: AWSEncodableShape {
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(spaceId: String) {
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeregisterAdminInput: AWSEncodableShape {
        /// The ID of the admin to remove.
        public let adminId: String
        /// The ID of the private re:Post to remove the admin from.
        public let spaceId: String

        @inlinable
        public init(adminId: String, spaceId: String) {
            self.adminId = adminId
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.adminId, key: "adminId")
            request.encodePath(self.spaceId, key: "spaceId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetChannelInput: AWSEncodableShape {
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(channelId: String, spaceId: String) {
            self.channelId = channelId
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.channelId, key: "channelId")
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.channelId, name: "channelId", parent: name, max: 24)
            try self.validate(self.channelId, name: "channelId", parent: name, min: 24)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetChannelOutput: AWSDecodableShape {
        /// A description for the channel. This is used only to help you identify this channel.
        public let channelDescription: String?
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The name for the channel. This must be unique per private re:Post.
        public let channelName: String
        /// The channel roles associated to the users and groups of the channel.
        public let channelRoles: [String: [ChannelRole]]?
        /// The status pf the channel.
        public let channelStatus: ChannelStatus
        /// The date when the channel was created.
        public let createDateTime: Date
        /// The date when the channel was deleted.
        public let deleteDateTime: Date?
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(channelDescription: String? = nil, channelId: String, channelName: String, channelRoles: [String: [ChannelRole]]? = nil, channelStatus: ChannelStatus, createDateTime: Date, deleteDateTime: Date? = nil, spaceId: String) {
            self.channelDescription = channelDescription
            self.channelId = channelId
            self.channelName = channelName
            self.channelRoles = channelRoles
            self.channelStatus = channelStatus
            self.createDateTime = createDateTime
            self.deleteDateTime = deleteDateTime
            self.spaceId = spaceId
        }

        private enum CodingKeys: String, CodingKey {
            case channelDescription = "channelDescription"
            case channelId = "channelId"
            case channelName = "channelName"
            case channelRoles = "channelRoles"
            case channelStatus = "channelStatus"
            case createDateTime = "createDateTime"
            case deleteDateTime = "deleteDateTime"
            case spaceId = "spaceId"
        }
    }

    public struct GetSpaceInput: AWSEncodableShape {
        /// The ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(spaceId: String) {
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetSpaceOutput: AWSDecodableShape {
        public let applicationArn: String?
        /// The ARN of the private re:Post.
        public let arn: String
        /// The Identity Center identifier for the Application Instance.
        public let clientId: String
        /// The configuration status of the private re:Post.
        public let configurationStatus: ConfigurationStatus
        /// The content size of the private re:Post.
        public let contentSize: Int64?
        /// The date when the private re:Post was created.
        public let createDateTime: Date
        /// The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.
        public let customerRoleArn: String?
        /// The date when the private re:Post was deleted.
        public let deleteDateTime: Date?
        /// The description of the private re:Post.
        public let description: String?
        /// The list of groups that are administrators of the private re:Post.
        public let groupAdmins: [String]?
        public let identityStoreId: String?
        /// The name of the private re:Post.
        public let name: String
        /// The AWS generated subdomain of the private re:Post
        public let randomDomain: String
        /// A map of accessor identifiers and their roles.
        public let roles: [String: [Role]]?
        /// The unique ID of the private re:Post.
        public let spaceId: String
        /// The creation or deletion status of the private re:Post.
        public let status: String
        /// The storage limit of the private re:Post.
        public let storageLimit: Int64
        public let supportedEmailDomains: SupportedEmailDomainsStatus?
        /// The pricing tier of the private re:Post.
        public let tier: TierLevel
        /// The list of users that are administrators of the private re:Post.
        public let userAdmins: [String]?
        /// The number of users that have onboarded to the private re:Post.
        public let userCount: Int?
        /// The custom AWS KMS key ARN that’s used for the AWS KMS encryption.
        public let userKMSKey: String?
        /// The custom subdomain that you use to access your private re:Post. All custom subdomains must be approved by AWS before use.
        public let vanityDomain: String
        /// The approval status of the custom subdomain.
        public let vanityDomainStatus: VanityDomainStatus

        @inlinable
        public init(applicationArn: String? = nil, arn: String, clientId: String, configurationStatus: ConfigurationStatus, contentSize: Int64? = nil, createDateTime: Date, customerRoleArn: String? = nil, deleteDateTime: Date? = nil, description: String? = nil, identityStoreId: String? = nil, name: String, randomDomain: String, roles: [String: [Role]]? = nil, spaceId: String, status: String, storageLimit: Int64, supportedEmailDomains: SupportedEmailDomainsStatus? = nil, tier: TierLevel, userCount: Int? = nil, userKMSKey: String? = nil, vanityDomain: String, vanityDomainStatus: VanityDomainStatus) {
            self.applicationArn = applicationArn
            self.arn = arn
            self.clientId = clientId
            self.configurationStatus = configurationStatus
            self.contentSize = contentSize
            self.createDateTime = createDateTime
            self.customerRoleArn = customerRoleArn
            self.deleteDateTime = deleteDateTime
            self.description = description
            self.groupAdmins = nil
            self.identityStoreId = identityStoreId
            self.name = name
            self.randomDomain = randomDomain
            self.roles = roles
            self.spaceId = spaceId
            self.status = status
            self.storageLimit = storageLimit
            self.supportedEmailDomains = supportedEmailDomains
            self.tier = tier
            self.userAdmins = nil
            self.userCount = userCount
            self.userKMSKey = userKMSKey
            self.vanityDomain = vanityDomain
            self.vanityDomainStatus = vanityDomainStatus
        }

        @available(*, deprecated, message: "Members groupAdmins, userAdmins have been deprecated")
        @inlinable
        public init(applicationArn: String? = nil, arn: String, clientId: String, configurationStatus: ConfigurationStatus, contentSize: Int64? = nil, createDateTime: Date, customerRoleArn: String? = nil, deleteDateTime: Date? = nil, description: String? = nil, groupAdmins: [String]? = nil, identityStoreId: String? = nil, name: String, randomDomain: String, roles: [String: [Role]]? = nil, spaceId: String, status: String, storageLimit: Int64, supportedEmailDomains: SupportedEmailDomainsStatus? = nil, tier: TierLevel, userAdmins: [String]? = nil, userCount: Int? = nil, userKMSKey: String? = nil, vanityDomain: String, vanityDomainStatus: VanityDomainStatus) {
            self.applicationArn = applicationArn
            self.arn = arn
            self.clientId = clientId
            self.configurationStatus = configurationStatus
            self.contentSize = contentSize
            self.createDateTime = createDateTime
            self.customerRoleArn = customerRoleArn
            self.deleteDateTime = deleteDateTime
            self.description = description
            self.groupAdmins = groupAdmins
            self.identityStoreId = identityStoreId
            self.name = name
            self.randomDomain = randomDomain
            self.roles = roles
            self.spaceId = spaceId
            self.status = status
            self.storageLimit = storageLimit
            self.supportedEmailDomains = supportedEmailDomains
            self.tier = tier
            self.userAdmins = userAdmins
            self.userCount = userCount
            self.userKMSKey = userKMSKey
            self.vanityDomain = vanityDomain
            self.vanityDomainStatus = vanityDomainStatus
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "applicationArn"
            case arn = "arn"
            case clientId = "clientId"
            case configurationStatus = "configurationStatus"
            case contentSize = "contentSize"
            case createDateTime = "createDateTime"
            case customerRoleArn = "customerRoleArn"
            case deleteDateTime = "deleteDateTime"
            case description = "description"
            case groupAdmins = "groupAdmins"
            case identityStoreId = "identityStoreId"
            case name = "name"
            case randomDomain = "randomDomain"
            case roles = "roles"
            case spaceId = "spaceId"
            case status = "status"
            case storageLimit = "storageLimit"
            case supportedEmailDomains = "supportedEmailDomains"
            case tier = "tier"
            case userAdmins = "userAdmins"
            case userCount = "userCount"
            case userKMSKey = "userKMSKey"
            case vanityDomain = "vanityDomain"
            case vanityDomainStatus = "vanityDomainStatus"
        }
    }

    public struct InternalServerException: AWSErrorShape {
        public let message: String
        /// Advice to clients on when the call can be safely retried.
        public let retryAfterSeconds: Int?

        @inlinable
        public init(message: String, retryAfterSeconds: Int? = nil) {
            self.message = message
            self.retryAfterSeconds = retryAfterSeconds
        }

        public init(from decoder: Decoder) throws {
            let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
            let container = try decoder.container(keyedBy: CodingKeys.self)
            self.message = try container.decode(String.self, forKey: .message)
            self.retryAfterSeconds = try response.decodeHeaderIfPresent(Int.self, key: "Retry-After")
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
        }
    }

    public struct ListChannelsInput: AWSEncodableShape {
        /// The maximum number of channels to include in the results.
        public let maxResults: Int?
        /// The token for the next set of channel to return. You receive this token from a previous ListChannels operation.
        public let nextToken: String?
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, spaceId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListChannelsOutput: AWSDecodableShape {
        /// An array of structures that contain some information about the channels in the private re:Post.
        public let channels: [ChannelData]
        /// The token that you use when you request the next set of channels.
        public let nextToken: String?

        @inlinable
        public init(channels: [ChannelData], nextToken: String? = nil) {
            self.channels = channels
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case channels = "channels"
            case nextToken = "nextToken"
        }
    }

    public struct ListSpacesInput: AWSEncodableShape {
        /// The maximum number of private re:Posts to include in the results.
        public let maxResults: Int?
        /// The token for the next set of private re:Posts to return. You receive this token from a previous ListSpaces operation.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListSpacesOutput: AWSDecodableShape {
        /// The token that you use when you request the next set of private re:Posts.
        public let nextToken: String?
        /// An array of structures that contain some information about the private re:Posts in the account.
        public let spaces: [SpaceData]

        @inlinable
        public init(nextToken: String? = nil, spaces: [SpaceData]) {
            self.nextToken = nextToken
            self.spaces = spaces
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "nextToken"
            case spaces = "spaces"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The ARN of the resource that the tags are associated with.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The list of tags that are associated with the resource.
        public let tags: [String: String]?

        @inlinable
        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct RegisterAdminInput: AWSEncodableShape {
        /// The ID of the administrator.
        public let adminId: String
        /// The ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(adminId: String, spaceId: String) {
            self.adminId = adminId
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.adminId, key: "adminId")
            request.encodePath(self.spaceId, key: "spaceId")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ResourceNotFoundException: AWSErrorShape {
        public let message: String
        /// The ID of the resource.
        public let resourceId: String
        /// The type of the resource.
        public let resourceType: String

        @inlinable
        public init(message: String, resourceId: String, resourceType: String) {
            self.message = message
            self.resourceId = resourceId
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case resourceId = "resourceId"
            case resourceType = "resourceType"
        }
    }

    public struct SendInvitesInput: AWSEncodableShape {
        /// The array of identifiers for the users and groups.
        public let accessorIds: [String]
        /// The body of the invite.
        public let body: String
        /// The ID of the private re:Post.
        public let spaceId: String
        /// The title of the invite.
        public let title: String

        @inlinable
        public init(accessorIds: [String], body: String, spaceId: String, title: String) {
            self.accessorIds = accessorIds
            self.body = body
            self.spaceId = spaceId
            self.title = title
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.accessorIds, forKey: .accessorIds)
            try container.encode(self.body, forKey: .body)
            request.encodePath(self.spaceId, key: "spaceId")
            try container.encode(self.title, forKey: .title)
        }

        public func validate(name: String) throws {
            try self.validate(self.accessorIds, name: "accessorIds", parent: name, max: 1000)
            try self.validate(self.body, name: "body", parent: name, max: 600)
            try self.validate(self.body, name: "body", parent: name, min: 1)
            try self.validate(self.title, name: "title", parent: name, max: 200)
            try self.validate(self.title, name: "title", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accessorIds = "accessorIds"
            case body = "body"
            case title = "title"
        }
    }

    public struct ServiceQuotaExceededException: AWSErrorShape {
        public let message: String
        /// The code to identify the quota.
        public let quotaCode: String
        /// The id of the resource.
        public let resourceId: String
        /// The type of the resource.
        public let resourceType: String
        /// The code to identify the service.
        public let serviceCode: String

        @inlinable
        public init(message: String, quotaCode: String, resourceId: String, resourceType: String, serviceCode: String) {
            self.message = message
            self.quotaCode = quotaCode
            self.resourceId = resourceId
            self.resourceType = resourceType
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case quotaCode = "quotaCode"
            case resourceId = "resourceId"
            case resourceType = "resourceType"
            case serviceCode = "serviceCode"
        }
    }

    public struct SpaceData: AWSDecodableShape {
        /// The ARN of the private re:Post.
        public let arn: String
        /// The configuration status of the private re:Post.
        public let configurationStatus: ConfigurationStatus
        /// The content size of the private re:Post.
        public let contentSize: Int64?
        /// The date when the private re:Post was created.
        public let createDateTime: Date
        /// The date when the private re:Post was deleted.
        public let deleteDateTime: Date?
        /// The description for the private re:Post. This is used only to help you identify this private re:Post.
        public let description: String?
        /// The name for the private re:Post.
        public let name: String
        /// The AWS generated subdomain of the private re:Post.
        public let randomDomain: String
        /// The unique ID of the private re:Post.
        public let spaceId: String
        /// The creation/deletion status of the private re:Post.
        public let status: String
        /// The storage limit of the private re:Post.
        public let storageLimit: Int64
        public let supportedEmailDomains: SupportedEmailDomainsStatus?
        /// The pricing tier of the private re:Post.
        public let tier: TierLevel
        /// The number of onboarded users to the private re:Post.
        public let userCount: Int?
        /// The custom AWS KMS key ARN that’s used for the AWS KMS encryption.
        public let userKMSKey: String?
        /// This custom subdomain that you use to access your private re:Post. All custom subdomains must be approved by AWS before use.
        public let vanityDomain: String
        /// This approval status of the custom subdomain.
        public let vanityDomainStatus: VanityDomainStatus

        @inlinable
        public init(arn: String, configurationStatus: ConfigurationStatus, contentSize: Int64? = nil, createDateTime: Date, deleteDateTime: Date? = nil, description: String? = nil, name: String, randomDomain: String, spaceId: String, status: String, storageLimit: Int64, supportedEmailDomains: SupportedEmailDomainsStatus? = nil, tier: TierLevel, userCount: Int? = nil, userKMSKey: String? = nil, vanityDomain: String, vanityDomainStatus: VanityDomainStatus) {
            self.arn = arn
            self.configurationStatus = configurationStatus
            self.contentSize = contentSize
            self.createDateTime = createDateTime
            self.deleteDateTime = deleteDateTime
            self.description = description
            self.name = name
            self.randomDomain = randomDomain
            self.spaceId = spaceId
            self.status = status
            self.storageLimit = storageLimit
            self.supportedEmailDomains = supportedEmailDomains
            self.tier = tier
            self.userCount = userCount
            self.userKMSKey = userKMSKey
            self.vanityDomain = vanityDomain
            self.vanityDomainStatus = vanityDomainStatus
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case configurationStatus = "configurationStatus"
            case contentSize = "contentSize"
            case createDateTime = "createDateTime"
            case deleteDateTime = "deleteDateTime"
            case description = "description"
            case name = "name"
            case randomDomain = "randomDomain"
            case spaceId = "spaceId"
            case status = "status"
            case storageLimit = "storageLimit"
            case supportedEmailDomains = "supportedEmailDomains"
            case tier = "tier"
            case userCount = "userCount"
            case userKMSKey = "userKMSKey"
            case vanityDomain = "vanityDomain"
            case vanityDomainStatus = "vanityDomainStatus"
        }
    }

    public struct SupportedEmailDomainsParameters: AWSEncodableShape {
        public let allowedDomains: [String]?
        public let enabled: FeatureEnableParameter?

        @inlinable
        public init(allowedDomains: [String]? = nil, enabled: FeatureEnableParameter? = nil) {
            self.allowedDomains = allowedDomains
            self.enabled = enabled
        }

        public func validate(name: String) throws {
            try self.allowedDomains?.forEach {
                try validate($0, name: "allowedDomains[]", parent: name, max: 255)
                try validate($0, name: "allowedDomains[]", parent: name, min: 1)
            }
            try self.validate(self.allowedDomains, name: "allowedDomains", parent: name, max: 10)
            try self.validate(self.allowedDomains, name: "allowedDomains", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case allowedDomains = "allowedDomains"
            case enabled = "enabled"
        }
    }

    public struct SupportedEmailDomainsStatus: AWSDecodableShape {
        public let allowedDomains: [String]?
        public let enabled: FeatureEnableStatus?

        @inlinable
        public init(allowedDomains: [String]? = nil, enabled: FeatureEnableStatus? = nil) {
            self.allowedDomains = allowedDomains
            self.enabled = enabled
        }

        private enum CodingKeys: String, CodingKey {
            case allowedDomains = "allowedDomains"
            case enabled = "enabled"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The ARN of the resource that the tag is associated with.
        public let resourceArn: String
        /// The list of tag keys and values that must be associated with the resource. You can associate tag keys only, tags (key and values) only, or a combination of tag keys and tags.
        public let tags: [String: String]

        @inlinable
        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            try container.encode(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ThrottlingException: AWSErrorShape {
        public let message: String
        /// The code to identify the quota.
        public let quotaCode: String?
        ///  Advice to clients on when the call can be safely retried.
        public let retryAfterSeconds: Int?
        /// The code to identify the service.
        public let serviceCode: String?

        @inlinable
        public init(message: String, quotaCode: String? = nil, retryAfterSeconds: Int? = nil, serviceCode: String? = nil) {
            self.message = message
            self.quotaCode = quotaCode
            self.retryAfterSeconds = retryAfterSeconds
            self.serviceCode = serviceCode
        }

        public init(from decoder: Decoder) throws {
            let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
            let container = try decoder.container(keyedBy: CodingKeys.self)
            self.message = try container.decode(String.self, forKey: .message)
            self.quotaCode = try container.decodeIfPresent(String.self, forKey: .quotaCode)
            self.retryAfterSeconds = try response.decodeHeaderIfPresent(Int.self, key: "Retry-After")
            self.serviceCode = try container.decodeIfPresent(String.self, forKey: .serviceCode)
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case quotaCode = "quotaCode"
            case serviceCode = "serviceCode"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The ARN of the resource.
        public let resourceArn: String
        /// The key values of the tag.
        public let tagKeys: [String]

        @inlinable
        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            request.encodeQuery(self.tagKeys, key: "tagKeys")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateChannelInput: AWSEncodableShape {
        /// A description for the channel. This is used only to help you identify this channel.
        public let channelDescription: String?
        /// The unique ID of the private re:Post channel.
        public let channelId: String
        /// The name for the channel. This must be unique per private re:Post.
        public let channelName: String
        /// The unique ID of the private re:Post.
        public let spaceId: String

        @inlinable
        public init(channelDescription: String? = nil, channelId: String, channelName: String, spaceId: String) {
            self.channelDescription = channelDescription
            self.channelId = channelId
            self.channelName = channelName
            self.spaceId = spaceId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.channelDescription, forKey: .channelDescription)
            request.encodePath(self.channelId, key: "channelId")
            try container.encode(self.channelName, forKey: .channelName)
            request.encodePath(self.spaceId, key: "spaceId")
        }

        public func validate(name: String) throws {
            try self.validate(self.channelDescription, name: "channelDescription", parent: name, max: 255)
            try self.validate(self.channelDescription, name: "channelDescription", parent: name, min: 1)
            try self.validate(self.channelId, name: "channelId", parent: name, max: 24)
            try self.validate(self.channelId, name: "channelId", parent: name, min: 24)
            try self.validate(self.channelName, name: "channelName", parent: name, max: 64)
            try self.validate(self.channelName, name: "channelName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case channelDescription = "channelDescription"
            case channelName = "channelName"
        }
    }

    public struct UpdateChannelOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateSpaceInput: AWSEncodableShape {
        /// A description for the private re:Post. This is used only to help you identify this private re:Post.
        public let description: String?
        /// The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.
        public let roleArn: String?
        /// The unique ID of this private re:Post.
        public let spaceId: String
        public let supportedEmailDomains: SupportedEmailDomainsParameters?
        /// The pricing tier of this private re:Post.
        public let tier: TierLevel?

        @inlinable
        public init(description: String? = nil, roleArn: String? = nil, spaceId: String, supportedEmailDomains: SupportedEmailDomainsParameters? = nil, tier: TierLevel? = nil) {
            self.description = description
            self.roleArn = roleArn
            self.spaceId = spaceId
            self.supportedEmailDomains = supportedEmailDomains
            self.tier = tier
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.description, forKey: .description)
            try container.encodeIfPresent(self.roleArn, forKey: .roleArn)
            request.encodePath(self.spaceId, key: "spaceId")
            try container.encodeIfPresent(self.supportedEmailDomains, forKey: .supportedEmailDomains)
            try container.encodeIfPresent(self.tier, forKey: .tier)
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 255)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.supportedEmailDomains?.validate(name: "\(name).supportedEmailDomains")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "description"
            case roleArn = "roleArn"
            case supportedEmailDomains = "supportedEmailDomains"
            case tier = "tier"
        }
    }

    public struct ValidationException: AWSErrorShape {
        /// The field that caused the error, if applicable.
        public let fieldList: [ValidationExceptionField]?
        public let message: String
        /// The reason why the request failed validation.
        public let reason: ValidationExceptionReason

        @inlinable
        public init(fieldList: [ValidationExceptionField]? = nil, message: String, reason: ValidationExceptionReason) {
            self.fieldList = fieldList
            self.message = message
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case fieldList = "fieldList"
            case message = "message"
            case reason = "reason"
        }
    }

    public struct ValidationExceptionField: AWSDecodableShape {
        /// The name of the field.
        public let message: String
        /// Message describing why the field failed validation.
        public let name: String

        @inlinable
        public init(message: String, name: String) {
            self.message = message
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case name = "name"
        }
    }
}

// MARK: - Errors

/// Error enum for Repostspace
public struct RepostspaceErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Repostspace
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// User does not have sufficient access to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// Updating or deleting a resource can cause an inconsistent state.
    public static var conflictException: Self { .init(.conflictException) }
    /// Unexpected error during processing of request.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// Request references a resource which does not exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// Request would cause a service quota to be exceeded.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// Request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The input fails to satisfy the constraints specified by an AWS service.
    public static var validationException: Self { .init(.validationException) }
}

extension RepostspaceErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "ConflictException": Repostspace.ConflictException.self,
        "InternalServerException": Repostspace.InternalServerException.self,
        "ResourceNotFoundException": Repostspace.ResourceNotFoundException.self,
        "ServiceQuotaExceededException": Repostspace.ServiceQuotaExceededException.self,
        "ThrottlingException": Repostspace.ThrottlingException.self,
        "ValidationException": Repostspace.ValidationException.self
    ]
}

extension RepostspaceErrorType: Equatable {
    public static func == (lhs: RepostspaceErrorType, rhs: RepostspaceErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension RepostspaceErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
